<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateScanEventsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('scan_events', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->string('type', 60)->default('')->comment('扫码的类型 大写的常量值');
			$table->string('value', 50)->nullable()->comment('扫码的值 对应类型表中的字段 简单值');
			$table->text('data', 65535)->nullable()->comment('扫码的值 对应类型表中的字段 json数据结构');
			$table->integer('scan_count')->unsigned()->default(0)->comment('被扫码的次数');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('scan_events');
	}

}
